import 'package:flutter/cupertino.dart';

class AlertUtilSheetAction extends StatelessWidget {
  const AlertUtilSheetAction({
    super.key,
    this.widget,
    this.text = '',
    this.isDestructiveAction = false,
    this.callback,
  });

  final Widget? widget;
  final String text;
  final bool isDestructiveAction;
  final VoidCallback? callback;

  @override
  Widget build(BuildContext context) {
    return CupertinoActionSheetAction(
      onPressed: () {
        Navigator.of(context).pop();
        if (callback != null) callback!();
      },
      isDefaultAction: false,
      isDestructiveAction: isDestructiveAction,
      child: widget ?? Text(text),
    );
  }
}
